﻿@model SubmitReturnRequestModel
@using Nop.Web.Models.Order;
@{
    Layout = "~/Views/Shared/_ColumnsOne.cshtml";

    //title
    Html.AddTitleParts(T("PageTitle.ReturnItems").Text);
}
<div class="page return-request-page">
    <div class="page-title">
        <h1>@string.Format(T("ReturnRequests.Title").Text, Model.OrderId)</h1>
    </div>
    <div class="clear">
    </div>
    <div class="page-body">
        @if (!String.IsNullOrEmpty(Model.Result))
        {
            <div class="result">
                @Model.Result</div>
        }
        else
        {
            using (Html.BeginForm())
            {
            <fieldset class="form-fields products-box">
                <legend>@T("ReturnRequests.SelectProduct(s)")</legend>
                <dl>
                    <dd>
                        <table class="data-table">
                            <col />
                            <col />
                            <col width="1" />
                            <thead>
                                <tr>
                                    <th class="a-center">
                                        @T("ReturnRequests.Products.Name")
                                    </th>
                                    <th class="a-center">
                                        @T("ReturnRequests.Products.Price")
                                    </th>
                                    <th class="a-center">
                                        @T("ReturnRequests.Products.Quantity")
                                    </th>
                                </tr>
                            </thead>
                            <tbody>
                                @foreach (var item in Model.Items)
                                {   
                                    <tr>
                                        <td class="a-left">
                                            <a href="@Url.RouteUrl("Product", new { SeName = item.ProductSeName })" title="View details">@item.ProductName</a>
                                            @if (!String.IsNullOrEmpty(item.AttributeInfo))
                                            {
                                                <div class="attributes">
                                                    @Html.Raw(item.AttributeInfo)
                                                </div>
                                            }
                                        </td>
                                        <td class="a-left">
                                            @item.UnitPrice
                                        </td>
                                        <td class="a-left">
                                            <select name="quantity@(item.Id)">
                                                @for (int i = 0; i <= item.Quantity; i++)
                                                {
                                                    <option value="@(i)">@(i)</option>
                                                }
                                            </select>
                                        </td>
                                    </tr>
                                }
                            </tbody>
                        </table>
                    </dd>
                </dl>
            </fieldset>
            <fieldset class="form-fields why">
                <legend>@T("ReturnRequests.WhyReturning")</legend>
                <dl>
                    <dt>
                        @Html.LabelFor(model => model.ReturnReason):</dt>
                    <dd>
                        @Html.DropDownListFor(model => model.ReturnReason, Model.AvailableReturnReasons, new { @class = "return-reasons" })
                    </dd>
                    <dt>
                        @Html.LabelFor(model => model.ReturnAction):</dt>
                    <dd>
                        @Html.DropDownListFor(model => model.ReturnAction, Model.AvailableReturnActions, new { @class = "return-actions" })
                    </dd>
                    <dt>
                        @Html.LabelFor(model => model.Comments):</dt>
                    <dd>
                        @Html.TextAreaFor(model => model.Comments, new { @class = "comment" })
                        @Html.ValidationMessageFor(model => model.Comments)
                    </dd>
                </dl>
            </fieldset>
            <div class="clear">
            </div>
            <div class="buttons">
                <input type="submit" name="submit-return-request" class="button-1 submit-return-request-button" value="@T("ReturnRequests.Submit")" />
            </div>
            }
        }
    </div>
</div>
